package com.example.springboot_demo_redis_annotation_token.controller;

import com.example.springboot_demo_redis_annotation_token.annotation.ApiIdempotent;
import com.example.springboot_demo_redis_annotation_token.common.ServerResponse;
import com.example.springboot_demo_redis_annotation_token.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.Errors;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestTokenController {

    @Autowired
    private TestService testService;

    @ApiIdempotent
    @PostMapping(value = "testIdempotence",produces = {"application/json;charset=UTF-8"})
    public ServerResponse testIdempotence() {
        return testService.testIdempotence();
    }

}
